using System;
using System.Data;

namespace ChatServer
{
	/// <summary>
	///  Message split with | character
	///  [command] | data | results
	/// </summary>
	public class TextPackage
	{
		public string textmessage;
		public TextPackage ()
		{
			var str = Ullity.Split(textmessage,"|");
		}
		public static int Login(string id, string pass){
			Object retr = MainClass._d.ExcuteScalar(new object[]{
				"select id from tbluser where username = ?1 and password = ?2",
				id,Ullity.MD5Gen(pass)
			});
			Ullity.Log(Ullity.MD5Gen(pass));
			if(retr != null)Ullity.Log(retr.ToString());
			return (retr!=null)?(int)retr:-1;
		}


	}
}

